<template>
  <div class="invitation">
  <header-bar :text="title" :left="left"></header-bar>
    <div class="invitationtop">
        <h2>领1ETH理财基金</h2>
        <div><i class="iconfont icon-jiaobiao1"></i>限量1千个，领完即止<i class="iconfont icon-jiaobiao3"></i></div>
    </div>
    <div class="invcontent">
        <div>您的专属邀请码</div>
        <div>{{pageInfo.userinfo.inviteCode}}</div>
        <div>
            <div>奖励规则</div>
            <ul>
                <li>成功邀请5人注册，即能领取1ETH理财基金。</li>
                <li>邀请更多人注册，所有受邀者未来平台收益，推荐人均能获得其5%分润。</li>
            </ul>
        </div>
        <div class="invitebtn" @click="handClick">立即邀请</div>
        <div>
            <span @click="handGetMoney">有币！立即理财</span>
            <img src="../assets/in3.png" alt="">
        </div>
    </div>
    <div class="invitbottom">
        <div>温馨提示</div>
        <ul>
            <li>每人邀请好友最多获1ETH体验基金。</li>
            <li>理财基金仅限币金所平台理财使用，不可转赠或提现。</li>
            <li>理财所获收益可提现。</li>
        </ul>
    </div>
  </div>
</template>
<script>
import headerBar from "./main/header";
import Card from "./main/card";
import { Header ,MessageBox} from "mint-ui";
import util from '../assets/js/util.js'
import { mapState, mapGetters, mapMutations, mapActions } from "vuex";
export default {
  name: "Invitation",
  data() {
    return {
      title: "邀请好友",
      left: {
        status: true
      }
    };
  },
  methods: {
    handClick(){
      // if (!localStorage.getItem('userinfo')) {
      //     MessageBox.confirm('你还没有登录，去登录？').then(action => {
      //         var u = navigator.userAgent;
      //         var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
      //         var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      //         if (isAndroid) {
      //             window.bjsLauncher.logoff();
      //         } else if (isiOS) {
      //             window.location.href = "exit";
      //         } else {}
      //     });
      //     return false;
      // }
      this.$router.push({ path: "/inva" });
    },
    handGetMoney(){
      this.$router.push({ path: "/detail",query:{
          id:util.getLocalStorage('adid')
        } 
      });
    }
  },
  computed:{
    ...mapState([
      "pageInfo"
    ])
  },
  components: {
    headerBar,
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
@import url("../../static/css/invitation.css");
</style>
